<!--  -->
<template>
    <div>
      <Card>
        <p slot="title">
            <Icon class="rotate-title-icon" style="color:#2F65EB" type="minus"></Icon>
            凭证请领配置
            <Poptip placement="right-start" trigger="hover"  content="配置“凭证请领”流程中的参数">
                <Icon  style="color:#2d8cf0;cursor:pointer" type="information-circled"></Icon>
            </Poptip>
        </p>
        <div>
            <p>审批人数</p>
            <Select v-model="pzPeoples" >
                <Option  v-for="item in spList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
        </div>
        <div style="marginTop:10px;">
            <p>接单时是否须要反馈预计处理时间</p>
            <RadioGroup v-model="pzIsUploadCard">
                <Radio label="1" ><span>是</span></Radio>
                <Radio label="0" ><span>否</span></Radio>
            </RadioGroup>
        </div>
        <div style="marginTop:10px;">
            <Button v-if="btnp.xtgl_pzqlpzhi_bc" @click="savePzInfo"  class="zh-hollow" type="primary" >保存</Button>
        </div>
    </Card> 
    </div>
</template>

<script>
import util from '@/libs/util.js'
import {getPZCof,savePZCof} from '@/libs/system.js'
export default {
name:'',
    data () {
        return {
            userUuid:'',
            user_type:'',
            btnp:{},
            btn:{
                xtgl_pzqlpzhi_bc:false
            },
            pzPeoples:'1',
            pzIsUploadCard:'yes',
            spList:[
                {
                    label:'不需要审批',
                    value:'0'
                },
                {
                    label:'1人',
                    value:'1'
                },
                {
                    label:'2人',
                    value:'2'
                },
                {
                    label:'3人',
                    value:'3'
                }
            ],
        };
    },
    methods:{
        async getPzInfo(){
            let res= await getPZCof();
            let response=res.data;
            if(response.code==200){
                this.pzIsUploadCard=response.data.credentialforecast;
                this.pzPeoples=response.data.approver_num;
            }else{
                this.$Notice.error({
                    desc:response.msg
                })
            } 
        },
        async savePzInfo(){
            let res= await savePZCof(this.userUuid,this.pzIsUploadCard,this.pzPeoples);
            let response=res.data;
            if(response.code==200){
                this.$Notice.success({
                    desc:'已保存'
                })
            }else{
                this.$Notice.error({
                    desc:response.msg
                })
            }
        },
    },
    created(){
        util.isCustomer(this);
        this.getPzInfo();
        this.btnp=util.bpower(this,this.btn);
    }
}

</script>
<style lang='scss' >
</style>